home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / resources / src / openresource.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  1.2 KB  |  67 lines

  1. /*
  2.     (C) 1995 AROS - The Amiga Replacement OS
  3.     $Id$
  4.     $Log$
  5.     Desc:
  6.     Lang: english
  7. */
  8. #include "exec_intern.h"
  9. #include <exec/lists.h>
  10. #include <aros/libcall.h>
  11.  
  12. /*****************************************************************************
  13.  
  14.     NAME */
  15.     #include <exec/libraries.h>
  16.     #include <clib/exec_protos.h>
  17.  
  18.     __AROS_LH1(APTR, OpenResource,
  19.  
  20. /*  SYNOPSIS */
  21.     __AROS_LA(STRPTR, resName, A1),
  22.  
  23. /*  LOCATION */
  24.     struct ExecBase *, SysBase, 83, Exec)
  25.  
  26. /*  FUNCTION
  27.     Return a pointer to a previously installed resource addressed by name.
  28.     It this name can't be found NULL is returned.
  29.  
  30.     INPUTS
  31.     libName - Pointer to the resource's name.
  32.  
  33.     RESULT
  34.     Pointer to resource or NULL.
  35.  
  36.     NOTES
  37.  
  38.     EXAMPLE
  39.  
  40.     BUGS
  41.  
  42.     SEE ALSO
  43.     AddResource(), RemResource()
  44.  
  45.     INTERNALS
  46.  
  47.     HISTORY
  48.  
  49. *****************************************************************************/
  50. {
  51.     __AROS_FUNC_INIT
  52.  
  53.     __AROS_BASE_EXT_DECL(struct ExecBase *,SysBase)
  54.     APTR resource;
  55.  
  56.     /* Arbitrate for the resource list */
  57.     Forbid();
  58.  
  59.     /* Look for the resource in our list */
  60.     resource = (APTR) FindName (&SysBase->ResourceList, resName);
  61.  
  62.     /* All done. */
  63.     Permit();
  64.     return resource;
  65.     __AROS_FUNC_EXIT
  66. } /* OpenResource */
  67.